<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateActividad extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('actividad', function (Blueprint $table) {
            $table->increments('id_actividad');
            $table->integer('id_localidad')->nullable();
            $table->string('nombre',50);
            $table->string('descripcion',200);
            $table->date('fecha_inicio')->nullable();
            $table->date('fecha_fin')->nullable();

            //$table->primary('id_actividad');
            $table->foreign('id_localidad')->references('id_localidad')->on('localidad');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('actividad');
    }
}
